<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>For 循环</title>
</head>
<body>
	<script ztype="text/javascript">
		var sum=0;
		var i = 0;

		for (i = 0; i < 11; i++) {
			sum+=i;
		}
		document.write("1~10的和是"+sum);
	</script>
</body>
</html>